var app = angular.module('toppic_app',[]);
app.controller("topic_controller",function($scope,$http,$sce){
	$scope.intview = function(){
		plus.nativeUI.showWaiting('加载中...');
		$http({
			method:'post',
			url:apiRoot,
			data:{
				action:'Community.getSpecialNote',
				sid: typeId
			}
		}).then(function(result){
			var info = result.data.data;     
			$scope.res = info.note;				
			console.log(JSON.stringify($scope.res));   
			plus.nativeUI.closeWaiting();
		},function errorfunction(e){
			plus.nativeUI.closeWaiting();
			console.log(JSON.stringify(e));
		})
	}
})    


var ws,typeId;
document.addEventListener('plusready',function(){
	ws = plus.webview.currentWebview();
	topic_title = ws.topic_title;
	typeId = ws.typeId;
	$('.title').html(topic_title);
	appElement = document.querySelector('[ng-controller=topic_controller]');
	$scope = angular.element(appElement).scope();  
	$scope.intview();
	$scope.$apply();
})